const fs = require('node:fs');
const http = require('node:http');

const port = process.argv[2];

const server = http.createServer(function (req, res) {
  if(req.method === 'POST'){
    req.setEncoding('utf8');
    req.on('data', (chunk) => {
      res.write(chunk.toUpperCase());
    });
    req.on('end', () => {
      res.end();
    });
  }else{
    res.end('Not Support');
  }

});

server.listen(port)
